package gsm.cable.server.service;

import java.util.ArrayList;
import java.util.List;

import com.google.appengine.api.blobstore.BlobKey;
import com.google.appengine.api.blobstore.BlobstoreServiceFactory;

public class BlobService {

	public static void delete(String... keys) {
		if (keys != null) {
			List<BlobKey> keyList = new ArrayList<BlobKey>();
			for (String key : keys) {
				BlobKey blobKey = new BlobKey(key);
				keyList.add(blobKey);
			}

			if (keyList.size() > 0) {
				BlobstoreServiceFactory.getBlobstoreService().delete(keyList.toArray(new BlobKey[] {}));
			}
			return;
		}
		throw new RuntimeException("Exception while deleteing blobs");
	}
}
